package com.car.loan.project.xr.util.vo.report;

import com.car.loan.common.utils.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import lombok.Data;

/**
 * @author huangding
 * @date 2020/2/20 11:08
 */
@Data
public class RepaymentInfoVo {


    @ApiModelProperty("业务编号")
    private String businessNo;

    @ApiModelProperty("客户名称")
    private String customerName;

    @ApiModelProperty("车辆类型")
    private String carType;

    @ApiModelProperty("车辆性质")
    private String carNature;

    @ApiModelProperty("分期金额")
    private Double installmentAmount;

    @ApiModelProperty("合同车价")
    private Double sellAmount;

    @ApiModelProperty("融资金额")
    private BigDecimal financingAmount;

    @ApiModelProperty("合作商户")
    private String dealerName;

    @ApiModelProperty("期数")
    private Integer term;

    @ApiModelProperty("银行名称")
    private String bankName;

    @ApiModelProperty("部门名称")
    private String deptName;

    @ApiModelProperty("业务员")
    private String adminName;

    @ApiModelProperty("首期账单日")
    private String firstRepayDate;

    @ApiModelProperty("最后还款日")
    private String lastRepaymentDate;

    @ApiModelProperty("当前期数")
    private Integer currentTerm = 0;

    @ApiModelProperty("当前月还")
    private BigDecimal repayAmount = BigDecimal.ZERO;

    @ApiModelProperty("逾期金额（当前逾期金额）")
    private Double overdueAmount;

    @ApiModelProperty("垫款金额（已垫款金额）")
    private Double advancesAmount;


    @ApiModelProperty("宽限期")
    @JsonIgnore
    private Integer gracePeriod;

    @ApiModelProperty("每月利息")
    @JsonIgnore
    private BigDecimal monthRepayInterest;

    @ApiModelProperty("每月本金")
    @JsonIgnore
    private BigDecimal monthRepayPrincipal;

    @ApiModelProperty("首月利息")
    @JsonIgnore
    private BigDecimal firstRepayInterest;

    @ApiModelProperty("首月本金")
    @JsonIgnore
    private BigDecimal firstRepayPrincipal;

    @ApiModelProperty("末月利息")
    @JsonIgnore
    private BigDecimal lastRepayInterest;

    @ApiModelProperty("末月本金")
    private BigDecimal lastRepayPrincipal;

    @ApiModelProperty("车系型号")
    private String carName;

    public String getCarNature() {
        if (StringUtils.isNotEmpty(carNature)) {
            if ("1".equals(carNature)) {
                return "新车";
            } else if ("2".equals(carNature)) {
                return "二手车";
            } else {
                return "存量车";
            }
        }
        return carNature;
    }
}
